app.controller("indexCtrl",["$scope","$http","$timeout","adBuy",'count',
function($scope,$http,$timeout,adBuy,count){
	function scopeSwiper(){
		var mySwiper = new Swiper('.swiper-container', {
			autoplay: 1000,
			initialSlide: 0, 
			loop: true,
			autoplayDisableOnInteraction: false, 
			grabCursor: true, 
			autoplayStopOnLast: false, 
			preventClicks: true
		});
	}
	
	$http.get("http://h5.yztctech.net/api/axf/apihome.php")
	.success(function(data){
		$scope.slide=data.data.slide;
		$scope.menu=data.data.menu;
		$timeout(function(){
			scopeSwiper();
		},300)
	})
	
	$http.get("http://h5.yztctech.net/api/axf/apicategory.php?category=%E4%BC%98%E9%80%89%E6%B0%B4%E6%9E%9C")
	.success(function(data){
		$scope.arr= data.data
	})
	
	$http.get("http://h5.yztctech.net/api/axf/apicategory.php?category=%E7%89%9B%E5%A5%B6%E9%9D%A2%E5%8C%85")
	.success(function(data){
		$scope.arr2= data.data
	})
	
	$scope.Add = function(i,text){
		if(i.num){
			i.num++
		}else{
			i.num = 1;
		}
		adBuy.addCar(i,text);
		count.countFn();
	}
	
	
	
}])














